#define  _CRT_SECURE_NO_WARNINGS 1

#include"sort.h"

void TestInsert()
{
	int arr[] = { 3,4,1,5,7,8,6,0,9 };
	InsertSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestShell()
{
	int arr[] = { 4,1,5,7,8,6,0,9,2,3 };
	ShellSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestSelect()
{
	int arr[] = { 9,8,7,5,5,8,3,2,1 };
	SelectSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestBubble()
{
	int arr[] = { 9,8,7,6,5,4,3,2,1 };
	BubbleSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestHeap()
{
	int arr[] = { 5,6,2,8,9,2,1,0,3 };
	HeapSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestQuick()
{
	int arr[] = { 3,1,2,5,4 };
	//QuickSort1(arr, 0, sizeof(arr) / sizeof(arr[0]) - 1);
	//QuickSort2(arr, 0, sizeof(arr) / sizeof(arr[0]) - 1);
	QuickSort3(arr, 0, sizeof(arr) / sizeof(arr[0]) - 1);
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestMerge()
{
	int arr[] = { 5,6,2,8,9,2,1,0,3 };
	MergeSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

int main()
{
	srand((unsigned int)time(NULL));
	//TestInsert();
	//TestShell();
	//TestSelect();
	//TestBubble();
	//TestHeap();
	TestQuick();
	//TestMerge();
	return 0;
}